package com.wu.store.config.handler;

import com.wu.store.common.util.MessageEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ControllerException {
	@ResponseBody
	@ExceptionHandler(value = Exception.class)
	public MessageEntity exceptionHandler(Exception e) {
		// Todo 增加日志
		return new MessageEntity.Builder().success(false).message(e.getMessage()).data(null).create();
	}
}
